<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <!-- 引入react核心库 -->
    <script type="text/javascript" src="../../js/react.development.js"></script>
    <!-- 用于支持react操作DOM -->
    <script type="text/javascript" src="../../js/react-dom.development.js"></script>
    <!-- 用于将jsx转为js -->
    <script type="text/javascript" src="../../js/babel.min.js"></script>
</head>
<body>
    <div id="test"></div>
    <div id="test2"></div>

    <script type="text/babel">
        class MyComponent extends React.Component{
            render() {
                const {name, sex, age} = this.props
                return (
                    <ul>
                        <li>姓名：{name}</li>
                        <li>性别：{sex}</li>
                        <li>年龄：{age}</li>
                    </ul>
                )
            }
        }
        let p ={name:"bollu", sex:"男", age:30}
        ReactDOM.render(<MyComponent name="rollingball" sex="男" age={3}/>,document.getElementById("test"))
        ReactDOM.render(<MyComponent {...p}/>,document.getElementById("test2"))
    </script>
</body>
<style>
</style>
</html>